﻿@model PagedList.IPagedList<MVCBlog.Models.Post>
@{
    ViewBag.Title = HttpRuntime.Cache["BlogTitle"];
}
@using PagedList.Mvc; 
@using PagedList;

@section HeaderStuff {
    <link href="/Content/PagedList.css" rel="stylesheet" type="text/css" />
}
<h1 class="text-center">@HttpRuntime.Cache["BlogTitle"]</h1>

@foreach (var item in Model)
{
    <div class="blogPost">
        <h2><a href="/home/article/@Html.DisplayFor(modelItem => item.ID)">@Html.DisplayFor(modelItem => item.Title)</a></h2>
        <p class="postTagline">Posted by @Html.DisplayFor(modelItem => item.AspNetUser.DisplayName) on @Html.DisplayFor(modelItem => item.PostDate) in Category: @Html.DisplayFor(modelItem => item.Category.Name)</p>
        <p>@Html.DisplayFor(modelItem => item.Summary)</p>
        <p><a href="/home/article/@Html.DisplayFor(modelItem => item.ID)">Read More ...</a></p>
    </div>
}
@Html.PagedListPager((IPagedList)Model, page => Url.Action("Index", new { page }))